package com.sxt.springcloud.sys;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sxt.springcloud.sys.fallback.DeptClientFallbackService;
import com.sxt.sys.common.DataGridView;
import com.sxt.sys.common.ResultObj;
import com.sxt.sys.domain.Dept;
import com.sxt.sys.domain.User;
import com.sxt.sys.vo.DeptVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@Component
@FeignClient(value = "SPRINGCLOUD-PROVIDER-SYS",fallbackFactory = DeptClientFallbackService.class)
@RequestMapping("/p/dept")
public interface DeptClientService {




    /**
     * 加载部门管理左边的部门树的json
     */
    @RequestMapping("loadDeptManagerLeftTreeJson")
    DataGridView loadDeptManagerLeftTreeJson(@RequestBody DeptVo deptVo);

    /**
     * 查询
     */
    @RequestMapping("loadAllDept")
    DataGridView loadAllDept(@RequestBody DeptVo deptVo);

    /**
     * 加载最大的排序码
     * @param
     * @return
     */
    @RequestMapping("loadDeptMaxOrderNum")
    Map<String,Object> loadDeptMaxOrderNum();


    /**
     * 添加
     * @param deptVo
     * @return
     */
    @RequestMapping("addDept")
    ResultObj addDept(@RequestBody DeptVo deptVo);


    /**
     * 修改
     * @param deptVo
     * @return
     */
    @RequestMapping("updateDept")
    ResultObj updateDept(@RequestBody DeptVo deptVo);


    /**
     * 查询当前的ID的部门有没有子部门
     */
    @RequestMapping("checkDeptHasChildrenNode")
    Map<String,Object> checkDeptHasChildrenNode(@RequestBody DeptVo deptVo);

    /**
     * 删除
     * @param deptVo
     * @return
     */
    @RequestMapping("deleteDept")
    ResultObj deleteDept(@RequestBody DeptVo deptVo);

    /**
     * 加载门诊部门的树列表
     */
    @RequestMapping("loadDetpForSelectById")
    DataGridView loadDetpForSelectById();
}
